import React, { Component } from 'react';
import './style.scss'
import classnames from 'classnames'
class DemoClass extends Component {
    state = {
        show: false
    }
    render() {
        return (<>
            <h3>9.动态class-数组方式</h3>
            <div className='classA'>颜色</div>
            <div className={[this.state.show ?'classA':'classC classD','classB'].join(' ')}>颜色</div>
            {/* classnames */}
            <div className={classnames('classA','classB')}>classnames-动态class</div>
            <div className={classnames({show:true})}>classnames-动态class</div>
            <div className={classnames('a',['a1','ab'])}>classnames-动态class</div>
        </>);
    }
}

export default DemoClass;